package service.impl;

import bean.pojo.Medical;
import dao.MedicalDao;
import dao.impl.MedicalDaoImpl;
import service.MedicalAppointmentService;

import java.util.List;

/**
 * service.impl
 * User: 李雨行
 * Date: 2024/12/16 16:47
 * motto:   沉淀哥
 * Description:
 * Version: V1.0
 */
public class MedicalAppointmentServiceImpl implements MedicalAppointmentService {
    private static MedicalDao medicalDao=new MedicalDaoImpl();

    @Override
    public List<Medical> findByPage(Integer appointmentId, Integer userId, String medicalItem, Integer page, Integer limit) {
        if ( medicalItem!=null && medicalItem.trim().length()==0 ){
            medicalItem=null;
        }
        return medicalDao.findByPage(appointmentId,userId,medicalItem,page,limit);
    }

    @Override
    public boolean add(Medical medical) {
        return medicalDao.add(medical);
    }

    @Override
    public boolean deleteById(Integer id) {
        return medicalDao.deleteById(id);
    }

    @Override
    public boolean update(Medical medical) {
        return medicalDao.update(medical);
    }

    @Override
    public Integer maxPage(Integer appointmentId, Integer userId, String medicalItem, Integer page, Integer limit) {
        return medicalDao.maxPage(appointmentId,userId,medicalItem,page,limit);
    }
}
